<?
class HotelReviewForm extends Form
{
    function __construct()
    {
        Form::Form('HotelReviewForm');
        $this->link_css('style/jquery-ui-1.9.2.custom.css');
        $this->link_css('style/msgBoxLight.css');
        $this->link_css('style/reset.min.css');
        $this->link_css('style/front-top-one-rate.css');
        $this->link_js('javascript/jquery/jquery-ui-1.9.2.custom.min.js');
        $this->link_js('javascript/search_box.js');
        $this->link_js("javascript/jquery/jquery.msgBox.js");

    }

    function draw()
    {
        global $display;
        //review
        $id = (int)Url::get('id');
        if ($id) {
            $review = Db_HotelReview::showReviewActiveByHotelId($id);
            if (!empty($review) && $review['active'] != 0) {
                $hotel = Db_Hotel::getHotelById($id);
                $review['created_time'] = date('d-m-Y', $review['created_time']);
                if (!empty($hotel['rating_0_0_average']) && !empty($review)) {
                    $display->add('avg', $hotel['rating_0_0_average']);
                    $display->add('review', $review);
                    $display->add('feel', Db_HotelReview::getFeelByScore($hotel['rating_0_0_average']));
                    $display->add("WEB_ROOT", WEB_ROOT);
                    $display->add("WEB_DIR", WEB_DIR);
                    $display->output('hotel_review');
                }
            }
        }
    }
}

?>